#pragma once
#include "base/mutex.h"
#include "base/noncopyable.h"

#include <pthread.h>
namespace net_tools::base{

class Condition : noncopyable{
 public:
  explicit Condition(Mutex& mutex);
  ~Condition();
  void Wait();
  void Signal_one();
  void Signal_all();
 private:
  Condition() = delete;
  pthread_cond_t cond_;
  Mutex&         mutex_;
};

} // namespace net_tools::base